﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web;

namespace TestPetaPoco.Common
{
    public enum ResponseErrorCode
    {
        [Description("请求参数为空")]
        RequestArgsIsNull = 1,

        [Description("请求参数类型传送不正确")]
        RequestArgsTypeOf = 2,

        [Description("请求参数反序列化失败")]
        RequestArgsDeserialize = 3,

        /// <summary>
        /// 违反数据约束
        /// </summary>
        [Description("违反数据约束")]
        DataConstraint = 4,

        /// <summary>
        /// 执行过程出错
        /// </summary>
        [Description("执行过程出错")]
        Executeing = 5,

        [Description("用户名或密码不正确")]
        UserNameOrPasswordError = 6,

        [Description("认证信息为空")]
        KeyIsNull = 7,

        [Description("未知错误")]
        Other = 8,

        /// <summary>
        /// 重复请求
        /// </summary>
        [Description("重复请求")]
        RepeartAction = 9,
    }


    public class ResponseError
    {
        public ResponseError()
        {

        }
        public ResponseError(ResponseErrorCode code)
        {
            this.Code = code;
        }
        public ResponseError(ResponseErrorCode code, string message)
        {
            this.Code = code;
            this.Message = message;
        }
        public ResponseErrorCode Code { get; set; }

        public string Message { get; set; }

        public int Code2 { get; set; }
    }
}